package com.cos.controller;

import com.cos.commons.R;
import com.cos.service.GoodsService;
import com.cos.vo.Goods;
import com.cos.vo.SearchGoodsParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.List;

@Controller
@RequestMapping("/search")
public class SearchListCotroller {
    @Autowired
    private GoodsService goodsService;
    @RequestMapping("/searchList")
    public String searchList(SearchGoodsParam param , ModelMap modelMap) throws IllegalAccessException, IOException, InvocationTargetException {
        List<Goods> search = goodsService.search(param);
        modelMap.put("searchList",search);
        return "searchList";
    }
}
